package com.cmict.data.system.dal.mysql.encode;

import com.cmict.data.framework.common.pojo.PageResult;
import com.cmict.data.framework.mybatis.core.mapper.BaseMapperX;
import com.cmict.data.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cmict.data.system.controller.admin.encode.vo.EncodeDataPageReqVO;
import com.cmict.data.system.dal.dataobject.encode.EncodeDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface EncodeMapper extends BaseMapperX<EncodeDO> {

    default PageResult<EncodeDO> selectPage(EncodeDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EncodeDO>()
                .likeIfPresent(EncodeDO::getEncodeName, reqVO.getEncodeName())
                .orderByDesc(EncodeDO::getCreateTime));
    }
}
